using System;

namespace SubversionReports.Web
{
    public partial class Error : System.Web.UI.Page
    {
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            ExceptionLabel.Text = "There was an error processing the last request.";
            if (Session["LastException"] != null)
            {
                Exception ex = Session["LastException"] as Exception;
                if(ex != null)
                {
                    ExceptionMessage.Text = ex.Message;
                    ExceptionSource.Text = string.Format("Source: {0}", ex.Source);
                    ExceptionStackTrace.Text = ex.StackTrace;
                }
            }
        }
    }
}
